home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 12 - 1996 / 12.11 Nov 96 / SMTPSender Code / src / SMTPDelEPThreadProc.cp < prev    next >
Encoding:
Text File  |  1996-08-27  |  1.1 KB  |  45 lines  |  [TEXT/CWIE]

  1. /***************************************************************************
  2.     File:        SMTPDelEPThreadProc.cp
  3.     Version:    1.0
  4.     Purpose:    A simple thread which simply deletes an object when 
  5.                 next scheduled. Note that object must have been 
  6.                 allocated from the standard new heap
  7.  
  8.     Author:     Christopher Haupt (cfh)
  9.                 Copyright © 1996, Christopher Haupt
  10.     
  11.     Revision History:
  12.     960418.cfh     New file
  13. ***************************************************************************/
  14.  
  15. #pragma once
  16.  
  17. #include "SMTPDelEPThreadProc.h"
  18. #include <LEndpoint.h>
  19. #include <LMacTCPEndpoint.h>
  20. #include <LOpenTptEndpoint.h>
  21.  
  22. // ---------------------------------------------------------------------------
  23. //        • DeleteObject
  24. // ---------------------------------------------------------------------------
  25. //
  26. void DeleteEndpointObject(LThread& , void* inObject)
  27. {
  28.     LThread::Yield();
  29.     
  30.     switch (((LEndpoint *) inObject)->GetEndpointType())
  31.     {
  32.         case LMacTCPEndpoint::class_ID:
  33.             delete ((LMacTCPEndpoint *)inObject);
  34.             break;
  35.  
  36.         case LOpenTptEndpoint::class_ID:
  37.             delete ((LOpenTptEndpoint *)inObject);
  38.             break;
  39.             
  40.         default:
  41.             delete ((LEndpoint *)inObject);
  42.             break;
  43.     }
  44. }
  45.